<div dw-loading="tableBrandShopLoading" class="pd10">
    <table class="responsive-table centered bordered" ng-if="vm.getType == 'shop'">
        <thead>
            <tr>
                <th>店铺名称</th>
                <th>主营类目</th>
                <th>店铺类型</th>
                <th>店铺等级</th>
                <th ng-click="vm.sort('sell_money','down')">
                    <span class="cp">近30天销售额</span>
                    <i class="caret down icon cp" ng-class="{'caret down icon cp':true,'green-text':vm.filter.sortColumn == 'sell_money'}"></i>
                </th>
                <th ng-click="vm.sort('sell_amount','down')">
                    <span class="cp">近30天销售量</span>
                    <i class="caret down icon cp" ng-class="{'caret down icon cp':true,'green-text':vm.filter.sortColumn == 'sell_amount'}"></i>
                </th>
                <th>成交均价</th>
                <th>店铺详情</th>
                <th>店铺商品</th>
                <th>监控</th>
            </tr>
        </thead>
        <tbody>
            <tr class="repeat-item" dir-paginate="shop in vm.table.shops | itemsPerPage: vm.filter.count" total-items="vm.table.count" current-page="vm.filter.newPageNumber" pagination-id="tableBrandShops">
                <td ng-if="shop.userId">
                    <a href="http://store.taobao.com/shop/view_shop.htm?user_number_id={{shop.userId}}" target="_blank" ng-bind-html="shop.shopName | highlight:vm.controllerFilter.q"></a>
                </td>
                <td ng-if="shop.userId">{{shop.mainCategory}}</td>
                <td ng-if="shop.userId">{{shop.shopType | shopType}}</td>
                <td ng-if="shop.userId">
                    <img ng-src="http://trendata.oss-cn-hangzhou.aliyuncs.com/marketconditions/credit{{shop.shopLevelType}}.png" style="width: 18px;" ng-repeat="i in shop.shopLevels track by $index">
                </td>
                <td ng-if="shop.userId" class="hisData cp" uid="{{shop.userId}}" dim="historySellMoney" jq-popup popup-config="shop" popup-type="'shop'" popup-dim="'historySellMoney'">{{shop.sellMoney | bigNum}}</td>
                <td ng-if="shop.userId" class="hisData cp" uid="{{shop.userId}}" dim="historySellAmount" jq-popup popup-config="shop" popup-type="'shop'" popup-dim="'historySellAmount'">{{shop.sellAmount | bigNum}}</td>
                <td ng-if="shop.userId">{{shop.avgPrice}}</td>
                <!-- 店铺详情监控 -->
                <td ng-if="shop.userId" ng-click="vm.getShopBasic($event,$index)">
                    <i class="fa fa-pie-chart cp f16"></i>
                </td>
                <td ng-if="shop.userId">
                    <a ng-click="vm.getBrandShopProds(shop)" class="cp">商品</a>
                </td>
     
                <td ng-if="shop.userId" class="monitorTd" add-monitor add-monitor-config="shop" add-monitor-type="'shop'">
                    <i class="fa cp" ng-class="{'fa-toggle-on':shop.collectionStatus,'fa-toggle-off':!shop.collectionStatus}"></i>
                </td>
                <td ng-if="!shop.userId" colspan="10">
                    <div class="pb30">
                        <shop-stat-data-component shop-uid="shop.uid" ng-if="shop.uid"></shop-stat-data-component>                        
                    </div>
                </td>
            </tr>

            <tr ng-show="vm.table.shops.length==0">
                <td colspan="10">暂无数据</td>
            </tr>
        </tbody>
    </table>
    <div class="center-align pd10" ng-if="vm.controllerFilter"  ng-if="vm.getType == 'shop'">
        <dir-pagination-controls on-page-change="vm.pageChanged(newPageNumber)" pagination-id="tableBrandShops" boundary-links="true"></dir-pagination-controls>
    </div>


    <!-- monitor.controller -->
    <table class="responsive-table centered bordered" ng-if="vm.getType == 'monitorShop'">
        <thead>
            <tr>
                <th>店铺名称</th>
                <th>主营类目</th>
                <th>店铺类型</th>
                <th>店铺等级</th>
                <th>近30天销售额</th>
                <th>近30天销售量</th>
                <th>成交均价</th>
                <th>店铺详情</th>
                <th>店铺商品</th>
                <th>监控数据</th>
                <th>取消监控</th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="shop in vm.table.shops">
                <td ng-if="shop.userId">
                    <a href="http://store.taobao.com/shop/view_shop.htm?user_number_id={{shop.userId}}" target="_blank" ng-bind="shop.shopName"></a>
                </td>
                <td ng-if="shop.userId">{{shop.mainCategory}}</td>
                <td ng-if="shop.userId">{{shop.shopType | shopType}}</td>
                <td ng-if="shop.userId">
                    <img ng-src="http://trendata.oss-cn-hangzhou.aliyuncs.com/marketconditions/credit{{shop.shopLevelType}}.png" style="width: 18px;" ng-repeat="i in shop.shopLevels track by $index">
                </td>
                <td ng-if="shop.userId" class="hisData cp" uid="{{shop.userId}}" dim="historySellMoney" jq-popup popup-config="shop" popup-type="'shop'" popup-dim="'historySellMoney'">{{shop.sellMoney | bigNum}}</td>
                <td ng-if="shop.userId" class="hisData cp" uid="{{shop.userId}}" dim="historySellAmount" jq-popup popup-config="shop" popup-type="'shop'" popup-dim="'historySellAmount'">{{shop.sellAmount | bigNum}}</td>
                <td ng-if="shop.userId">{{shop.avgPrice}}</td>
                <!-- 店铺详情监控 -->
                <td ng-if="shop.userId" ng-click="vm.getShopBasic($event,$index)">
                    <i class="fa fa-pie-chart cp f16"></i>
                </td>
                <td ng-if="shop.userId">
                    <a ng-click="vm.getBrandShopProds(shop)" class="cp">商品</a>
                </td>

                <td ng-if="shop.userId" title="点击查看历史数据" class="cp" ng-click="vm.getMonitorData($event,$index)">
                    <i class="fa fa-line-chart" style="font-size: 16px;" ></i>
                </td>

                <td ng-if="shop.userId" class="monitorTd" ng-click="vm.deleteCollection(shop)">
                    <i class="fa fa-trash-o"></i>
                </td>
                <td ng-if="!shop.userId" colspan="11">
                   <!-- 店铺详情 -->
                    <shop-stat-data-component shop-uid="shop.uid" ng-if="shop.uid"></shop-stat-data-component>
                    <!-- 日监控数据 -->
                   <monitor-day-component target-id="shop.targetId" monitor-day-type ="'shop'" ng-if="shop.targetId"></monitor-day-component>
                </td>
            </tr>

            <tr ng-show="vm.table.shops.length==0">
                <td colspan="11">暂无店铺监控数据</td>
            </tr>
        </tbody>
    </table>
</div>
